package com.sdp.wx.db.wx_emp.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.sdp.wx.db.wx_emp.entity.WxEmp;
import com.sdp.wx.db.wx_emp.mapper.WxEmpMapper;
import com.sdp.wx.db.wx_emp.service.IWxEmpService;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author zsp
 * @since 2024-01-09
 */
@Service
public class WxEmpServiceImpl extends ServiceImpl<WxEmpMapper, WxEmp> implements IWxEmpService {

	@Override
	public WxEmp queryEmpByEmpNo(String empNo) {
		LambdaQueryWrapper<WxEmp> queryWrapper = new LambdaQueryWrapper<>();
		queryWrapper.eq(WxEmp::getEmpNo, empNo);
		return getOne(queryWrapper,false);
	}

	@Override
	public List<WxEmp> queryEmpsByEmpNos(List<String> empNos) {
		LambdaQueryWrapper<WxEmp> queryWrapper = new LambdaQueryWrapper<>();
		queryWrapper.in(WxEmp::getEmpNo, empNos);
		return list(queryWrapper);
	}

	@Override
	public List<WxEmp> queryEmpsByEmpType(String empType) {
		LambdaQueryWrapper<WxEmp> queryWrapper = new LambdaQueryWrapper<>();
		queryWrapper.eq(WxEmp::getEmpType, empType);
		return list(queryWrapper);
	}

	@Override
	public List<WxEmp> queryEmps() {
		LambdaQueryWrapper<WxEmp> queryWrapper = new LambdaQueryWrapper<>();
		return list(queryWrapper);
	}

}
